package com.holly.unit.bpmn.modular.activiti.controller;

import com.holly.unit.bpmn.activiti.ActivitiOperator;
import com.holly.unit.bpmn.activiti.pojo.ActButtonRequest;
import com.holly.unit.core.pojo.response.ResponseData;
import com.holly.unit.core.pojo.response.SuccessResponseData;
import com.holly.unit.scanner.api.annotation.ApiResource;
import com.holly.unit.scanner.api.annotation.GetResource;
import com.holly.unit.scanner.api.annotation.PostResource;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
* @Description: 入口管理
* @Author: holly
* @Date:   2022-03-21 02:44:34
* @Version: V1.0
*/
@RestController
@ApiResource(name = "流程定义设置按钮权限")
@Api(tags = "流程定义设置按钮权限")
public class ActButtonController {

    @Resource
    private ActivitiOperator operator;

   /**
    * 添加
    * @param actButtonRequest
    * @return
    */
   @PostResource(name = "按钮权限_增加", path = "/button/add", requiredPermission = false , requiredLogin = false)
   public ResponseData add(@RequestBody ActButtonRequest actButtonRequest) {
       operator.addButton(actButtonRequest);
       return new SuccessResponseData();
   }

   /**
     * 列表查询
     * @author holly
     * @date 2022-03-21 02:44:34
     */
    @ApiOperation(value = "按钮权限_查询" ,notes = "按钮权限_查询")
    @GetResource(name = "按钮权限_查询", path = "/button/list", requiredPermission = false , requiredLogin = false)
    public ResponseData list(ActButtonRequest actButtonRequest) {
        return new SuccessResponseData(operator.selectButton(actButtonRequest));
    }


}
